﻿<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TrainingsRequestsExt>" %>--%>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TrainingsRequestsExt>" %>
<%@ Import Namespace="CRM.Resourses" %>
<%@ Import Namespace="CRM.Models" %>

<%
    var contactsCol = new CRM.Database.Model.ContactsCollection();
    Html.DevExpress().ComboBox(settings =>
    {
        settings.Name = "IdContact";
        settings.CallbackRouteValues = new { Controller = "TC", Action = "TrainingsRequestContactPartial", key = Model.Key };
        settings.Width = 496;
        settings.Properties.EnableCallbackMode = true;
        settings.Properties.ValueField = "IdContact";
        settings.Properties.ValueType = typeof(int);
        settings.Properties.Columns.Add("Name", Resourses.Name, Unit.Percentage(50));
        settings.Properties.Columns.Add("Phone", Resourses.Phone, Unit.Percentage(25));
        settings.Properties.Columns.Add("Email", Resourses.Email, Unit.Percentage(25));
        settings.Properties.DropDownWidth = 496;
        settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
        settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['LE'] = IdLegalEntity.GetValue(); }";
    }).BindList(contactsCol.GetFullDefinedContactsByLegalEntityId(Model.IdLegalEntity)).Bind(Model.IdContact).GetHtml();
    //}).BindList(DB.GetFullDefinedContactsByLegalEntityId(Model.IdLegalEntity)).Bind(Model.IdContact).GetHtml();
%>